<?php
/**
 * User:于小涛
 * Date:2020/2/17
 * Time:15:37
 */
namespace app\admin\controller\file;

use app\admin\BaseController;
use app\admin\business\file\File as FileBusiness;
use think\App;

class Upload extends BaseController {
    private $obj_file_business = null;
    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->obj_file_business = new FileBusiness();
    }

    public function uploadImage(){
        $arr_re=$this->obj_file_business->uploadVideoImage('image');
        if($arr_re['ret']==0){
            $arr_data=array(
                'file_id'=>$arr_re['data']['id'],
                'url'=>config('filesystem.disks.public.url').'/'.$arr_re['data']['url'],
                'original_name'=>$arr_re['data']['original_name'],
            );
            return output_data($arr_data);
        }else{
            return output_data(array(),'上传文件失败');
        }
    }

}